//导入模块
import Vue from 'vue';
import VueRouter from 'vue-router';

import UserLogin from '@/views/UserLogin.vue'
import GoodsList from '@/views/GoodsList.vue'
import PersonalCenter from '@/views/PersonalCenter.vue'
import HandledOrder from '@/views/HandledOrder.vue'
import UnHandledOrder from '@/views/UnHandledOrder.vue'

//注册路由组件
Vue.use(VueRouter);

//编写路由规则
const routes = [
    {
        path: "/",
        name: 'UserLogin',
        component: UserLogin
    },
    {
        path: "/goodsList",
        name: "goodsList",
        component: GoodsList
    },
    {
        path: "/personalCenter",
        name: "personalCenter",
        component: PersonalCenter
    },
    {
        path: "/unHandledOrder",
        name: "unHandledOrder",
        component: UnHandledOrder
    },
    {
        path: "/handledOrder",
        name: "handledOrder",
        component: HandledOrder
    }
]
//创建路由
const router = new VueRouter({
    mode: 'history',
    routes
})
//导出
export default router;